#ifndef PAGE3_WIDGET_H
#define PAGE3_WIDGET_H

#include <QWidget>
#include <QDebug>
#include <stdio.h>
#include <string.h>
//#include "user/welcomewidget.h"
#include "ui_welcomewidget.h"
#include "qmqtt.h"

using namespace QMQTT;

class WelcomeWidget;



class Page3_Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Page3_Widget(WelcomeWidget *widget);
    ~Page3_Widget();

private slots:
    void on_pb_connect_mqtt_clicked();
    void on_pb_publish_clicked();
    void on_pb_sub_clear_clicked();
    void on_pb_subscription_clicked();

public slots:
    void slot_do_mqtt_connect();   //MQTT 连接成功
    void slot_do_mqtt_disconnect();  //MQTT连接断开
    void slot_do_mqtt_data_recv(QMQTT::Message message);     //MQTT收到数据

private:

    WelcomeWidget *welcomewidget;
    Ui::WelcomeWidget *welcome_ui;

    QString mqtt_server_ip;
    QString mqtt_server_port;
    QMQTT::Client *mqtt_client; //MQTT客户端指针
};


#endif


